package xy.come.juhenews.Adapter;

import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import xy.come.juhenews.Bean.NewsBean;
import xy.come.juhenews.R;

/**
 * Created by Xia_焱 on 2018/7/12.
 * e-mail：XiahaotianV@163.com
 */

public class NewsListAdapter extends BaseQuickAdapter<NewsBean.ResultBean.DataBean, BaseViewHolder> {
    public NewsListAdapter(int layoutResId, @Nullable List<NewsBean.ResultBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, NewsBean.ResultBean.DataBean item) {
        ImageView iv_title = helper.getView(R.id.iv_title);//.placeholder(R.mipmap.ic_launcher)

         Glide.with(mContext).load(item.getThumbnail_pic_s()).into(iv_title);
        helper.setText(R.id.tv_title,item.getTitle())
                .setText(R.id.tv_tag,item.getAuthor_name())
                .setText(R.id.tv_time,item.getDate());
    }
}
